package com.raymond.queue.common.msg.request;

import com.alibaba.fastjson.JSONObject;
import com.raymond.queue.common.enums.CommandIdType;
import com.raymond.queue.common.msg.BaseAgreement;
import com.raymond.queue.common.msg.BaseMessage;
import com.raymond.queue.common.msg.DefaultMessage;

/**
 * 创建topic请求
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-07-14 14:24
 */
public class CreateTopicRequest extends DefaultMessage {
    /**
     * 主题名称
     */
    private String topic;
    /**
     * 0代表不同消费队列，1代表发布订阅
     */
    private int queueModel;
    /**
     * 消费组名称
     */
    private String groupName;

    /**
     * 0:从上次消费的开始,如果不存在上次消费,则按最后一条开始
     * 1:从当前最后一条开始
     * 2:从某个消费组开始
     * 3:从首条开始
     */
    private int growMode;

    public CreateTopicRequest() {
        super(0);
    }

    public CreateTopicRequest(int sequenceId) {
        super(sequenceId);
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getQueueModel() {
        return queueModel;
    }

    public void setQueueModel(int queueModel) {
        this.queueModel = queueModel;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public int getGrowMode() {
        return growMode;
    }

    public void setGrowMode(int growMode) {
        this.growMode = growMode;
    }


    @Override
    public int getCommandId() {
        return CommandIdType.CREATE_TOPIC_REQ.getCommandId();
    }


}
